\setscript[hanzi]
\setupalign[hanging, hz]

\usemodule[zhfontsext]
\usetypescript[cnfontb]
\setupbodyfont[cnfontb,rm,12pt] % 小四号 = 12pt
\mainlanguage[cn]

\setupinterlinespace[line=3.66ex] %line=3.05ex相当于WORD 中的1.0倍行距, 3.66ex相当于WORD 中的1.2倍行距

\setuppapersize[A4]
\setuplayout[width=fit,height=fit,backspace=10mm,cutspace=10mm,topspace=10mm,margin=10mm,header=10mm,footer=10mm]
\setuppagenumbering[location={header,right},style=\bfb]

\define[1]\exampleLine{
    \blank[10pt]
    \framed[frame=off,align=flushleft,offset=3pt,strut=none,width=\textwidth,height=fit,background=color,backgroundcolor=gray]{{\bfx #1}}
    \blank[5pt]
}
\starttext

\exampleLine{代码示例 - 9:}
\vskip 2cm
\setupframed[width=4.5cm,height=2.5cm]
\ruledhbox{
    A \quad
\framed[align={flushleft,top},location=top]{{\darkgray align=}flushleft top\\{\darkgray location=}top} \quad
\framed[align={flushleft,top},location=lohi]{{\darkgray align=}flushleft top\\{\darkgray location=}lohi} \quad
\framed[align={flushleft,top},location=low]{{\darkgray align=}flushleft top\\{\darkgray location=}low} \quad
B
}
\vskip1.5cm


\ruledhbox{
    A \quad
\framed[align={flushleft,lohi},location=top]{{\darkgray align=}flushleft lohi\\{\darkgray location=}top} \quad
\framed[align={flushleft,lohi},location=lohi]{{\darkgray align=}flushleft lohi\\{\darkgray location=}lohi} \quad
\framed[align={flushleft,lohi},location=low]{{\darkgray align=}flushleft lohi\\{\darkgray location=}low} \quad
B
}
\vskip1.5cm

\ruledhbox{
    A \quad
\framed[align={flushleft,low},location=top]{{\darkgray align=}flushleft low\\{\darkgray location=}top} \quad
\framed[align={flushleft,low},location=lohi]{{\darkgray align=}flushleft low\\{\darkgray location=}lohi} \quad
\framed[align={flushleft,low},location=low]{{\darkgray align=}flushleft low\\{\darkgray location=}low} \quad
B
}





\stoptext